//
//  JGWithdrawalProgressController.m
//  JGRider
//
//  Created by 单启志 on 2018/2/1.
//  Copyright © 2018年 ffq. All rights reserved.
//

#import "JGWithdrawalProgressController.h"
#import "JGWithdrawalProgressCell.h"
#import "JGWithdrawalProgressModel.h"
#import "JGWithdrawalRecordController.h"
@interface JGWithdrawalProgressController ()<UITableViewDelegate,UITableViewDataSource>
@property(nonatomic,strong)UITableView *tableView;
@property(nonatomic,strong)NSArray<JGWithdrawalProgressModel*>* datas;
@end

@implementation JGWithdrawalProgressController
static NSString *cellId=@"withdrawalProgressCell";
- (void)viewDidLoad {
    [super viewDidLoad];
    [self configSubViews];
}

-(void)configSubViews{

    self.title=@"提现进度";
    self.datas=[JGWithdrawalProgressModel models];
    [self.view addSubview:self.tableView];
}

#pragma mark - tableview delegate


-(NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section{
    return self.datas.count;
}

-(CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath{

    return AdaptedHeight(62);
}

-(UITableViewCell*)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{

    JGWithdrawalProgressCell *cell=[tableView dequeueReusableCellWithIdentifier:cellId];
    cell.model=self.datas[indexPath.row];
    return cell;
}

-(void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath{


}

#pragma mark -override
-(UIImage *)lmjNavigationBarRightButtonImage:(UIButton *)rightButton navigationBar:(LMJNavigationBar *)navigationBar{

    [rightButton setTitle:@"提现记录" forState:UIControlStateNormal];
    rightButton.titleLabel.font=[UIFont systemFontOfSize:13];
    rightButton.width=80;
    return nil;
}

-(void)rightButtonEvent:(UIButton *)sender navigationBar:(LMJNavigationBar *)navigationBar{
    JGWithdrawalRecordController *vc=[[JGWithdrawalRecordController alloc]init];
    JGpushViewController(vc);
    NSLog(@"提现记录");
}

#pragma mark - getter setter
-(UITableView *)tableView{

    if (!_tableView) {

        _tableView =[[UITableView alloc]initWithFrame:CGRectMake(0,self.lmj_navgationBar.height, JGScreenW, JGScreenH-self.lmj_navgationBar.height) style:UITableViewStylePlain];
        _tableView.contentInset=UIEdgeInsetsMake(AdaptedHeight(6), 0, 0, 0);
        [_tableView registerNib:[UINib nibWithNibName:NSStringFromClass([JGWithdrawalProgressCell class]) bundle:nil] forCellReuseIdentifier:cellId];

        _tableView.showsVerticalScrollIndicator=NO; _tableView.separatorStyle=UITableViewCellSeparatorStyleNone;
        _tableView.delegate=self;
        _tableView.dataSource=self;
    }

    return _tableView;

}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

@end
